package com.wayhome.srpingbootmybatis.utils.cob;

import java.util.TreeMap;

public class AppTest {

    public static void main(String[] args) throws Exception {
        sign();
    }

    public static void sign() {
        TreeMap<String, String> treeMap = new TreeMap<String, String>();
        treeMap.put("pid", "NCPS0001");
        treeMap.put("merId", "104310153111011");
        treeMap.put("termId", "31010000");
        treeMap.put("orderId", "20160512134348");
        treeMap.put("txnTime", "20160512134348");
        treeMap.put("txnAmt", "2.34");
        treeMap.put("txnType", "01");
        treeMap.put("txnSubType", "11");
        treeMap.put("merNameExt", "二级商户名称");
        treeMap.put("frontUrl", "http://10.2.56.12:9083/ncpkjMer/index.jsp");
        treeMap.put("ccyCode", "156");
        treeMap.put("reqReserved", "请求方保留域");
        try {
            // 返回签名结果
            String sign = CertP7.sign(ConvertData.convertToSign(treeMap));
            System.out.println("签名的字符串：");
            System.out.println(sign);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
